<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html" ; charset="utf-8" />
    <title>分期未缴清信息查询</title>
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />
    <link
      href="../../../bstable/css/bootstrap.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../../../bstable/css/bootstrap-table.css"
      rel="stylesheet"
      type="text/css"
    />

    <style>
      .bootstrap-table {
        padding: 20px;
      }
    </style>
  </head>

  <body>
    <div class="tabe_div">
      <p
        class="p_line text_ient"
        style="border-bottom: 0; margin-bottom: -10px"
      >
        <a class="find_a">报考类型：</a>
        <select id="type" class="form_select" style="padding-left: 1%">
          <option value="">全部</option>
          <option value="education">学历提升</option>
          <option value="occupation">职业技能</option>
          <option value="title">职称评审</option>
          <option value="train">执业资格</option>
        </select>
        <a class="find_a">学生身份证号：</a>
        <input
          id="idNo"
          maxlength="18"
          type="text"
          class="form_input text_ient"
          placeholder="请输入学生18位身份证号"
        />
        <a class="find_a">学生姓名：</a>
        <input
          id="student-name"
          maxlength="11"
          type="text"
          class="form_input text_ient"
          placeholder="请填写学生姓名"
        />
        <!-- <a class="find_a">学生手机号</a>
            <input id="mobile" maxlength="11" type="text" class="form_input text_ient" placeholder="请填写学生手机号" /> -->
        <input type="button" value="查询" class="but_find" id="search" />
      </p>
      <p class="p_line text_ient" style="margin-bottom: -10px">
        <a class="find_a">审核状态：</a>
        <select class="form_select" style="padding-left: 1%" id="status">
          <option value="">全部</option>
          <option value="0">已保存</option>
          <option value="1">已提交</option>
          <option value="2">待财务审核</option>
          <option value="3">财务驳回</option>
          <option value="4">待教务审核</option>
          <option value="5">教务驳回</option>
          <option value="6">教务确认</option>
          <option value="8">已退款</option>
          <option value="10">财务确认</option>
        </select>
        <a class="find_a">分期缴费时间：</a>
        <input
          id="start"
          maxlength="11"
          type="date"
          class="form_input text_ient"
          placeholder="缴费起止日期"
        />
        -
        <input
          id="end"
          maxlength="11"
          type="date"
          class="form_input text_ient"
          placeholder="缴费起止日期"
        />
      </p>
      <table
        data-url="json/data_alae_list.json"
        id="table"
        class="table_style"
        style="margin: 0 auto"
      ></table>
    </div>
    <script src="../../../js/jquery.js"></script>
    <script src="../../../js/common.js"></script>
    <script src="../../../js/date/js/laydate.js"></script>
    <script src="../../../bstable/js/bootstrap.min.js"></script>
    <script src="../../../bstable/js/bootstrap-table.js"></script>
    <script src="../../../bstable/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="../../../layer_v2.1/layer/layer.js"></script>
    <script type="text/javascript">
      localStorage.setItem("name", "财务管理/分期未缴清信息查询");

      function changeFee(ids) {
        var arr = ids.split(",");
        $.ajax({
          url: baseUrl + "studentInfo/setStudentFeeFlag",
          method: "get",
          headers: {
            Authorization: JSON.parse(localStorage.getItem("userInfo")).token,
          },
          data: {
            studentId: arr[0],
            feeId: arr[1],
            feeFlag: arr[2],
          },
          success: function (data) {
            $("#table").bootstrapTable("refresh");
            alert("操作成功");
          },
          error() {
            alert("操作失败");
          },
        });
      }
      $(function () {
        $("#search").on("click", function () {
          $("#table").bootstrapTable("refresh");
        });
        var perm = JSON.parse(localStorage.getItem("userInfo")).perm;
        $("#table").bootstrapTable({
          method: "get",
          striped: true,
          singleSelect: false,
          url: baseUrl + "studentInfo/getStudentList",
          dataType: "json",
          sidePagination: "server",
          pagination: true, //分页
          pageSize: 10,
          pageNumber: 1,
          // rowStyle:rowStyle,
          search: false, //显示搜索框
          contentType: "application/x-www-form-urlencoded",
          ajaxOptions: {
            headers: {
              Authorization: JSON.parse(localStorage.getItem("userInfo")).token,
            },
          },
          queryParams: function (params) {
            params.trainType = $("#type").val();
            params.idNo = $("#idNo").val().trim();
            params.name = $("#student-name").val().trim();
            params.commitFlag = $("#status").val();
            params.businessProgress = $("#businessProgress").val();
            params.startDate = $("#start").val();
            params.endDate = $("#end").val();
            params.userType = "fqjf";
            params.offset = params.offset / params.limit;
            delete params.order;
            return params;
          },
          responseHandler: function (res) {
            console.log(res);
            var list = res.data.result.records;
            var maps = {
              education: "学历提升",
              occupation: "职业技能",
              title: "职称评审",
              train: "执业资格",
            };
            list.forEach(function (item, i) {
              item.trainType = maps[item.trainType];
              !item && (list[i] = {});
              item.feeFlag = item.feeFlag == 1 ? "已缴费" : "未缴费";
            });

            return {
              rows: list,
              total: res.data.total,
            };
          },
          columns: [
            {
              field: "no",
              title: "序号",
              sortable: true,
              align: "center",
              width: 100,
              formatter: function (value, row, index) {
                var pageSize =
                  $("#table").bootstrapTable("getOptions").pageSize;
                var pageNumber =
                  $("#table").bootstrapTable("getOptions").pageNumber;
                return pageSize * (pageNumber - 1) + index + 1;
              },
            },
            {
              title: "学生姓名",
              field: "name",
              align: "center",
              valign: "middle",
            },
            {
              title: "身份证号",
              field: "idNo",
              align: "center",
            },
            {
              title: "报考类型",
              field: "trainType",
              align: "center",
            },
            {
              title: "招生老师姓名",
              field: "teacherName",
              align: "center",
            },
            {
              title: "招生老师手机号",
              field: "teacherMobile",
              align: "center",
            },
            {
              title: "应缴费用",
              field: "amount",
              align: "center",
            },
            {
              title: "缴费状态",
              field: "feeFlag",
              align: "center",
            },
            {
              title: "缴费时间",
              field: "term",
              align: "center",
            },
            {
              title: "报考进度",
              field: "submissionFlag",
              align: "center",
              formatter: function (value, row, index) {
                const map = { 0: "未报考", 1: "已报考" };
                return map[row.submissionFlag];
              },
            },
            {
              title: "证书",
              field: "receiveFlag",
              align: "center",
              formatter: function (value, row, index) {
                const map = { 0: "未领取", 1: "已领取" };
                return map[row.receiveFlag];
              },
            },
            {
              title: "审核状态",
              field: "commitStr",
              align: "center",
            },
            {
              title: "业务进度",
              field: "businessProgress",
              align: "center",
              formatter: function (value, row, index) {
                const map = { 0: "报考", 1: "退款", 2: "分期缴费" };
                return map[row.businessProgress];
              },
            },
          ],
        });
      });

      function look(id, idNo, flag) {
        window.location.href =
          "../hotel/student.html?type=look&from=jiaofei&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag;
      }

      function check(id, idNo, flag) {
        window.location.href =
          "../hotel/student.html?type=check&from=jiaofei&id=" +
          id +
          "&idNo=" +
          idNo +
          "&flag=" +
          flag;
      }

      // function rowStyle(item, index) {
      //     style = item.colorFlag == 1 ? {css:{'color':'#ed5565'}} : {}
      //     return style;
      // }
    </script>
  </body>
</html>
